package com.demo2do.fms.entity.data.business;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 仓库
 * 
 * @author Ysy
 */
@Entity
@Table(name = "VW_WAREHOUSE")
public class Warehouse {
    
    @Id
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "assigned")
	private Long id;
	
    /** 起始地目的地代码 */
    @Column(name = "FACILITY_CODE")
    private String code;
    
    /** 起始地目的地名称 */
    @Column(name = "FACILITY_NAME")
    private String name;
    
    /** 装卸地id */
    private Long loadPlaceId;
    
    /** 装卸地代码 */
    private String loadPlaceCode;
    
    /** 装卸地名称 */
    private String loadPlaceName;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(name = "geo_id", referencedColumnName = "id")
    @JsonIgnore(value = true)
    private City city;

    @Column(name = "is_disabled")
    private boolean disabled;

    /**
     * 
     * the default constructor
     */
    public Warehouse() {

    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }
    
    /**
     * @return the loadPlaceId
     */
    public Long getLoadPlaceId() {
        return loadPlaceId;
    }

    /**
     * @return the loadPlaceCode
     */
    public String getLoadPlaceCode() {
        return loadPlaceCode;
    }

    /**
     * @return the loadPlaceName
     */
    public String getLoadPlaceName() {
        return loadPlaceName;
    }

    /**
     * @return the city
     */
    public City getCity() {
        return city;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param code the code to set
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
    
    /**
     * @param loadPlaceId the loadPlaceId to set
     */
    public void setLoadPlaceId(Long loadPlaceId) {
        this.loadPlaceId = loadPlaceId;
    }

    /**
     * @param loadPlaceCode the loadPlaceCode to set
     */
    public void setLoadPlaceCode(String loadPlaceCode) {
        this.loadPlaceCode = loadPlaceCode;
    }

    /**
     * @param loadPlaceName the loadPlaceName to set
     */
    public void setLoadPlaceName(String loadPlaceName) {
        this.loadPlaceName = loadPlaceName;
    }

    /**
     * @param city the city to set
     */
    public void setCity(City city) {
        this.city = city;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
    
    
}
